package models

import (
	"github.com/astaxie/beego/orm"
)

type Product struct {
	Id           int
	Cover        string         `orm:"size(255)" description:"封面图"`
	Price        float64        `orm:"type(decimal)" description:"原价格"`
	RelPrice     float64        `orm:"type(decimal)" description:"真实价格"`
	Description  string         `orm:"type(text)" description:"富文本介绍"`
	FreeMail     int            `orm:"default(1)" description:"是否包邮  1是  0 不是"`
	Retail       int            `orm:"default(1)" description:"是否零售  1是  0 不是"`
	RetailPrice  float64        `orm:"type(decimal)" description:"零售价格"`
	ProdcutItems []*ProductItem `orm:"reverse(many)" description:"产品规格"`
	Shop         *Shop          `orm:"rel(fk)" description:"商品所属的商店"`
	Category     *Category      `orm:"rel(fk)" description:"商品分类"`
}

func init() {
	orm.RegisterModel(new(Product))
}
